<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>5_3_2-1-多具名插槽</title>
</head>

<body>


  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  <div id="Application">
    <my-container2>
      <template v-slot:header>
        <h1>这里是头部元素</h1>
      </template>
      <template v-slot:main>
        <p>内容部份</p>
        <p>内容部份</p>
      </template>
      <template v-slot:footer>
        <p>这里是尾部元素</p>
      </template>
    </my-container2>
  </div>
  <script>
    const App = Vue.createApp({});
    const container2Component = {
      template: `<div>
                <slot name="header"></slot>
                <hr>
                <slot name="main"></slot>
                <hr>
                <slot name="footer"></slot
                </div>`,
    };
    App.component("my-container2", container2Component);
    App.mount("#Application");
  </script>
</body>

</html>